package com.guchenbo.springboot.aop;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

@RestController
@RequestMapping("/")
public class IndexController {

    @Resource
    private BizService bizService;
    @Resource
    private HelloService helloService;

    @GetMapping(value = { "/ok", "/" })
    public String ok() {
        bizService.biz2("biz 2");
        try {
            bizService.biz("biz 2");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        helloService.say("hello 2");
        return "ok";
    }

}
